/*
 * @lc app=leetcode.cn id=598 lang=typescript
 *
 * [598] 范围求和 II
 */

// @lc code=start
function maxCount(m: number, n: number, ops: number[][]): number {
    if (ops.length === 0) return m * n;
    const [a, b] = ops.reduce(
        (col, [ai, bi]) => {
            col[0].push(ai);
            col[1].push(bi);
            return col;
        },
        [[], []] as number[][]
    );
    return Math.min(...a) * Math.min(...b);
}
// @lc code=end
